package chap6

//5. Write a Scala application, using the Apptrait, that prints the command-line
//arguments in reverse order, separated by spaces. For example, scala Reverse
//Hello Worldshould print World Hello.
object ArApp extends App {
  var reverse_args = "";
  args.reverse.foreach { reverse_args += _ + " " }
  println(reverse_args)
}

//D:\lessonScala\src\main\scala>scalac chap6/ArApp.scala
//
//D:\lessonScala\src\main\scala>ls -al chap6
//total 32
//drw-rw-rw-  2 ephraim 0 8192 2016-06-03 11:55 .
//drw-rw-rw-  6 ephraim 0    0 2016-06-03 10:12 ..
//-rw-rw-rw-  1 ephraim 0 1332 2016-06-03 11:55 ArApp$$anonfun$1.class
//-rw-rw-rw-  1 ephraim 0 3005 2016-06-03 11:55 ArApp$.class
//-rw-rw-rw-  1 ephraim 0  763 2016-06-03 11:55 ArApp$delayedInit$body.class
//-rw-rw-rw-  1 ephraim 0 1275 2016-06-03 11:55 ArApp.class
//-rw-rw-rw-  1 ephraim 0  153 2016-06-03 11:54 ArApp.scala
//-rw-rw-rw-  1 ephraim 0 1621 2016-06-03 11:54 Chap6.scala
//
//D:\lessonScala\src\main\scala>scala chap6.ArApp hello world ni hao
//hao ni world hello